
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main()

{

	int i = 0;
	while (scanf("%d", &i) != EOF)
	{
		if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
			printf("1");
		else
			printf("0");
	}



	return 0;

}